{js:areaSelect}
<article class="module width_full">
	<header>
		<h3 class="tabs_involved">订单发货</h3>
	</header>

	<form action="{url:/seller/order_delivery_doc}" method="post" id="deliver_form">
		<input type="hidden" name="order_no" value="{$order_no}"/>
		<input type="hidden" name="id" value="{$order_id}"/>
		<input type="hidden" name="user_id" value="{$user_id}"/>
		<input type="hidden" name="freight" value="{$real_freight}" />
		<input type="hidden" name="delivery_type" value="{$distribution}" />

		<fieldset>
			<table class="tablesorter clear">
				<thead>
					<tr>
						<th>商品名称</th>
						<th>商品价格</th>
						<th>购买数量</th>
						<th onclick="selectAll('sendgoods[]')">选择发货</th>
					</tr>
				</thead>

				<tbody>
					{set:$seller_id = $this->seller['seller_id']}
					{query:name=order_goods where=order_id eq $order_id and seller_id eq $seller_id}
					<tr>
						<td>
							{set:$goodsRow = JSON::decode($item['goods_array'])}
							{$goodsRow['name']} &nbsp;&nbsp; {$goodsRow['value']}
						</td>
						<td>{$item['real_price']}</td>
						<td>{$item['goods_nums']}</td>
						<td>
							{if:$item['is_send'] == 0}
							<input type="checkbox" name="sendgoods[]" value="{$item['id']}" />
							{else:}
							{echo:Order_class::goodsSendStatus($item['is_send'])}
							{/if}
						</td>
					</tr>
					{/query}
				</tbody>
			</table>
		</fieldset>

		<fieldset>
			<table class="tablesorter clear">
				<colgroup>
					<col width="120px" />
					<col />
					<col width="120px" />
					<col />
				</colgroup>

				<tbody>
					<tr>
						<th>订单号:</th><td align="left">{$order_no}</td>
						<th>下单时间:</th><td align="left">{$create_time}</td>
					</tr>
					<tr>
						<th>配送方式:</th>
						<td align="left">
							{query:name=delivery where=id eq $distribution}{$item['name']}{/query}
						</td>
						<th>配送费用:</th><td align="left">{$real_freight}</td>
					</tr>
					<tr>
						<th>保价费用:</th><td align="left">￥{$insured}</td>
					</tr>
					<tr>
						<th>收货人姓名:</th><td align="left"><input type="text" class="small" name="name" value="{$accept_name}" pattern="required"/></td>
						<th>电话:</th><td align="left"><input type="text" class="small" name="telphone" value="{$telphone}" pattern="phone" empty /></td>
					</tr>
					<tr>
						<th>手机:</th><td align="left"><input type="text" class="small" name="mobile" value="{$mobile}" pattern="mobi"/></td>
						<th>邮政编码:</th><td align="left"><input type="text" name="postcode" class="small" value="{$postcode}" pattern="zip" empty /></td>
					</tr>
					<tr>
						<th>物流公司：</th>
						<td align="left">
							<select name="freight_id" pattern="required" alt="选择物流公司" class="auto">
								<option value="">选择物流公司</option>
								{query:name=freight_company where=is_del eq 0}
								<option value="{$item['id']}">{$item['freight_name']}</option>
								{/query}
							</select>
							<label class="tip">选择物流公司</label>
						</td>
						<th>配送单号:</th><td align="left"><input type="text" class="normal" name="delivery_code" pattern="required"/></td>
					</tr>
					<tr>
						<th>地区:</th>
						<td align="left" colspan="3">
							<select name="province" child="city,area" class="auto"></select>
							<select name="city" child="area" class="auto"></select>
							<select name="area" pattern="required" class="auto"></select>
						</td>
					</tr>
					<tr>
						<th>地址:</th><td align="left" colspan="3"><input type="text" class="normal" name="address" value="{$address}" size="50" pattern="required"/></td>
					</tr>
					<tr>
						<th>发货单备注:</th><td align="left" colspan="3"><textarea name="note" class="normal"></textarea></td>
					</tr>
				</tbody>
			</table>
		</fieldset>

		<footer>
			<div class="submit_link">
				<input type="submit" class="alt_btn" value="确 定" onclick="return checkForm()" />
				<input type="reset" value="重 置" />
			</div>
		</footer>
	</form>
</article>

<script type="text/javascript">
//DOM加载完毕
$(function(){
	var areaInstance = new areaSelect('province');
	areaInstance.init({"province":"{$province}","city":"{$city}","area":"{$area}"});
});

//表单提交前检测
function checkForm()
{
	var checkedNum = $('input[name="sendgoods[]"]:checked').length;
	if(checkedNum == 0)
	{
		alert('请选择要发货的商品');
		return false;
	}
	return true;
}
</script>